From: Ilmari Karonen Date: Sun, 10 May 2009 20:33:55 +0000 (+0000) Subject: fix regression from r49677 by refusing to format old-style metadata even if a foreign... X-Git-Tag: 1.31.0-rc.0~41826 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=2364bc8edb906147156d23fff0c70b58e7589b36;p=lhc%2Fweb%2Fwiklou.git fix regression from r49677 by refusing to format old-style metadata even if a foreign repo hands us some --- diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index 80d5ff8f44..98453c2ef5 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -320,6 +320,16 @@ class BitmapHandler extends ImageHandler { if ( !$exif ) { return false; } + if ( !isset( $exif['MEDIAWIKI_EXIF_VERSION'] ) || + $exif['MEDIAWIKI_EXIF_VERSION'] != Exif::version() ) + { + // XXX: This should be caught by isMetadataValid(), but + // some non-local repos might call this function without + // checking validity, causing FormatExif to barf, so we + // check it again just to be sure. + wfDebug( __METHOD__.": wrong version\n" ); + return false; + } unset( $exif['MEDIAWIKI_EXIF_VERSION'] ); $format = new FormatExif( $exif );